package com.biz.primus.ms.commodity.trans;

import com.biz.primus.ms.commodity.dao.po.Extend;
import com.biz.primus.ms.commodity.dao.ro.ExtendRo;
import com.google.common.base.Function;
import org.springframework.beans.BeanUtils;

import javax.annotation.Nullable;

public class Extend2ExtendRo implements Function<Extend,ExtendRo> {
    @Nullable
    @Override
    public ExtendRo apply(@Nullable Extend extend) {
        ExtendRo extendRo = new ExtendRo();
        BeanUtils.copyProperties(extend,extendRo);
        extendRo.setCategoryId(extend.getCategoryId());
        extendRo.setId(extend.getKey());
        return extendRo;
    }
}
